package com.fred.learning.springbootdubbosampleconsumer;

import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.rpc.service.GenericService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.ws.rs.GET;

/**
 * @author fred
 * @date 2021/7/5 上午9:57
 * @description todo
 */
@RestController
public class DemoController {

    @DubboReference(interfaceName = "com.fred.learning.springbootdubbosampleprovider.service.IDemoSerive", generic = true)
    private GenericService genericService;

    @GetMapping("/demo")
    public String demo() {
        return genericService.$invoke("getText", new String[0], null).toString();
    }


}
